import cookie from '@/util/cookie'
import refreshToken from '@/util/refreshToken'
const user = {
    namespaced: true,
    state: {
       userInfo: localStorage.userInfo ? JSON.parse(localStorage.userInfo) : {}
    },
    getters: {
      isClient () {
         if (typeof(QCefClient) != 'undefined') {
             return true
         } else {
             return false
         }
     }
    },
    mutations: {
       setUserInfo (state, info) {
           state.userInfo = info
           localStorage.userInfo = JSON.stringify(info)
           cookie.set('userInfo', JSON.stringify(info), 100)
       },
       setToken (state, token) {
          cookie.set('authToken', JSON.stringify(token), 1)
          state.token = token
       }
    },
    actions: {
     
    }
}
export default user
